//
//  DriverAddInfoCell.m
//  LogisticsSupplier
//
//  Created by 吕晶 on 2021/3/24.
//  Copyright © 2021 吕晶. All rights reserved.
//

#import "DriverAddInfoCell.h"

@interface DriverAddInfoCell ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *contentLab;
@property (nonatomic, strong) UILabel *line;

@end

@implementation DriverAddInfoCell

+ (instancetype)DriverAddInfoCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"DriverAddInfoCell";
    DriverAddInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[DriverAddInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = Color_backgroundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, ScreenW - 30, 60)];
        self.bgView.backgroundColor = HexColor(0xffffff);
        [self.contentView addSubview:self.bgView];
        
        self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(10, 22.5, (self.bgView.nim_width - 20) * 0.5, 15)];
        self.titleLab.textColor = HexColor(0x2B2C44);
        self.titleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.titleLab];
        
        self.contentLab = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLab.nim_right, 22.5, (self.bgView.nim_width - 20) * 0.5, 15)];
        self.contentLab.textColor = HexColor(0x2B2C44);
        self.contentLab.font = [UIFont systemFontOfSize:14];
        self.contentLab.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.contentLab];
        
        self.line = [[UILabel alloc] initWithFrame:CGRectMake(10, 59.5, self.bgView.nim_width - 20, 0.5)];
        self.line.textColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line];
        
        self.height = self.bgView.nim_bottom;
    }
    return self;
}

-(void)setTitleStr:(NSString *)titleStr {
    _titleStr = titleStr;
    self.titleLab.text = titleStr;
}

-(void)setContentStr:(NSString *)contentStr {
    _contentStr = contentStr;
    self.contentLab.text = contentStr;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
